#include <iostream>
using namespace std;

int n, m;
int sum = 0;
bool choose[11];
void dfs(int x)
{
    if (sum == m)
    {
        for (int i = 1; i <= n; i++)
        {
            if (choose[i]) cout << i << " ";
        }
        cout << endl;
        return;
    }
    if (sum > x || x > n) return;

    sum += x;
    choose[x] = true;
    dfs(x + 1);
    sum -= x;
    choose[x] = false;
    dfs(x + 1);
}
int main()
{
    cin >> n >> m;
    dfs(1);
    return 0;
}